package com.land.study.intent;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class ReceiveActivity extends Activity {
	public static final String INTENT_EXTRA_KEY = "key";
	private TextView txtReceive;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		SLog.d("ReceiveActivity onCreate ");
		super.onCreate(savedInstanceState);
		setContentView(R.layout.receive_layout);
		txtReceive = (TextView) findViewById(R.id.txt_receive);
		
		Intent intent = getIntent();
		
		if (intent != null) {
			String s = null;
			ParcelableVO vo = intent.getParcelableExtra(INTENT_EXTRA_KEY);
			
			if (vo == null) {
				SLog.d("getting String from intent extra");
				s = intent.getStringExtra(INTENT_EXTRA_KEY);
			} else {
				SLog.d("getting String from Parcelable");
				s = vo.getTxt();
			}
			
			txtReceive.setText(s);
		}
	}
}
